package com.kc.data.common.service.impl;


import com.kc.data.common.domain.model.BizGoodsRelationCategory;
import com.kc.data.common.mapper.BizGoodsRelationCategoryMapper;
import com.kc.data.common.service.IBizGoodsRelationCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 商品关联类别实现接口
 */
@Service
public class BizGoodsRelationCategoryServiceImpl implements IBizGoodsRelationCategoryService {
    @Autowired
    private BizGoodsRelationCategoryMapper goodsRelationCategoryMapper;

    /**
     * 数据新增
     * @param bizGoodsRelationCategoryList
     * @return
     */
    @Override
    public Integer add(List<BizGoodsRelationCategory> bizGoodsRelationCategoryList) {
        for(BizGoodsRelationCategory relationCategory : bizGoodsRelationCategoryList) {
            goodsRelationCategoryMapper.insert(relationCategory);
        }
        return 1;
    }

    /**
     * 数据删除
     * @param goods_id
     * @return
     */
    @Override
    public Integer delete(Integer goods_id) {
        //return goodsRelationCategoryMapper.delete1(goods_id);
        return goodsRelationCategoryMapper.remove(goods_id);
    }
}
